home *** CD-ROM | disk | FTP | other *** search
/ Developer CD Series 1996 April: Mac OS SDK / Dev.CD Apr 96 SDK / Dev.CD Apr 96 SDK1.toast / Development Kits (Disc 1) / OpenDoc Development Framework / ODFDev / ODF / Examples / Bitmap / Include / BmpFrame.h < prev    next >
Encoding:
Text File  |  1995-11-08  |  3.6 KB  |  106 lines  |  [TEXT/MPS ]

  1. //========================================================================================
  2. //
  3. //    File:                BmpFrame.h
  4. //    Release Version:    $ 1.0d11 $
  5. //
  6. //    Author:                Henri Lamiraux
  7. //
  8. //    Copyright:    © 1993, 1995 by Apple Computer, Inc., all rights reserved.
  9. //
  10. //========================================================================================
  11.  
  12. #ifndef BMPFRAME_H
  13. #define BMPFRAME_H
  14.  
  15. // ----- Framework Includes -----
  16.  
  17. #ifndef FWFRAME_H
  18. #include "FWFrame.h"
  19. #endif
  20.  
  21. //========================================================================================
  22. //    Forward Declarations
  23. //========================================================================================
  24.  
  25. #if FW_LIB_EXPORT_PRAGMAS
  26. #pragma import on
  27. #endif
  28. class FW_CLASS_ATTR FW_CGrowBox;
  29. #if FW_LIB_EXPORT_PRAGMAS
  30. #pragma import off
  31. #endif
  32.  
  33. class FW_CLASS_ATTR CBitmapPart;
  34. class FW_CLASS_ATTR CBitmapSelection;
  35.  
  36. //========================================================================================
  37. //    class CBitmapFrame
  38. //========================================================================================
  39.  
  40. class FW_CLASS_ATTR CBitmapFrame : public FW_CFrame
  41. {
  42. //----------------------------------------------------------------------------------------
  43. //    Initialization/Destruction
  44. //
  45. public:
  46.     CBitmapFrame(Environment* ev, ODFrame* odFrame, FW_CPresentation* presentation, CBitmapPart* bitmapPart);
  47.     virtual ~ CBitmapFrame();
  48.     
  49. //----------------------------------------------------------------------------------------
  50. //    Inherited API
  51. //
  52. public:
  53.     virtual FW_Boolean        DoMenu(Environment* ev, const FW_CMenuEvent& theMenuEvent);
  54.     virtual FW_Boolean        DoAdjustMenus(Environment* ev, FW_CMenuBar* menuBar, FW_Boolean hasMenuFocus, FW_Boolean isRoot);
  55.  
  56.     virtual void            FocusStateChanged(Environment* ev, ODTypeToken focus, FW_Boolean newState, ODFrame* newOwner);
  57.     virtual void             FrameShapeChanged(Environment* ev);
  58.     
  59.     virtual ODShape*        AdjustUsedShape(Environment* ev, ODShape* suggestedUsedShape);
  60.     virtual ODShape*        AdjustActiveShape(Environment* ev, ODFacet* facet, ODShape* suggestedActiveShape);
  61.  
  62.     virtual void            AdjustZoomedWindowSize(Environment *ev, FW_CPoint& proposedSize);
  63.  
  64.     virtual void             Draw(Environment* ev, ODFacet* odFacet, ODShape* invalidShape);
  65.     virtual void            BuildThumbnail(Environment* ev, FW_CGraphicContext& gc, const FW_CRect& bounds);
  66.     
  67.     virtual FW_Boolean         DoMouseDown(Environment* ev, const FW_CMouseEvent& theMouseEvent);
  68.     
  69. #ifdef FW_BUILD_MAC
  70.     virtual ODDragResult    CanAcceptDrop(Environment* ev, ODDragItemIterator* dragInfo);
  71. #endif
  72.  
  73.     virtual FW_Boolean        DoIdle(Environment* ev, const FW_CNullEvent& theNullEvent);
  74.     
  75.     virtual void            CreateSubviews(Environment* ev);
  76.     virtual void            AdjustSubviews(Environment* ev);
  77.  
  78.     // ----- External/InternalizeFrame -----
  79.     virtual void            ExternalizeFrame(Environment* ev, ODStorageUnitView* storageUnitView);
  80.     virtual void            InternalizeFrame(Environment* ev, ODStorageUnitView* storageUnitView);
  81.  
  82. //----------------------------------------------------------------------------------------
  83. //    New API
  84. //
  85. public:
  86.     FW_CPoint                GetZoomRatio(Environment* ev) const;
  87.     void                    AdjustFrameSize(Environment* ev);
  88.  
  89.     void                    CalcUsedRect(Environment* ev, FW_CRect& newUsedRect) const;
  90.     
  91.     ODCommandID                GetChoosenSize() const
  92.                                 {return fChoosenSize;}
  93.                                 
  94. //----------------------------------------------------------------------------------------
  95. //    Data Members
  96. //
  97. private:
  98.     CBitmapPart*             fBitmapPart;        // Pointer to my part (to ovoid type cast)
  99.     ODCommandID                fChoosenSize;        // Choosen Size (50%, 100%, 200%, or fit to frame)
  100.     FW_CRect                fFrameRect;            // The lastest frame shape rect
  101.     FW_CGrowBox*             fGrowBox;
  102.     CBitmapSelection*        fSelection;
  103. };
  104.  
  105. #endif
  106.